package network.internal.io;

import static commons.Preconditions.checkNotNull;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.Socket;

import network.io.InputStreamFactory;

public class DefaultInputStreamFactory implements
		InputStreamFactory<Socket, ObjectInputStream> {

	@Override
	public ObjectInputStream createInputStream(final Socket source)
			throws IOException {
		checkNotNull("source must not be null.", source);
		return new ObjectInputStream(source.getInputStream());
	}
}
